package com.example.dblianxiwj;

import android.app.Activity;
import android.content.Intent;
import android.graphics.Color;
import android.os.Bundle;
import android.view.Menu;
import android.view.View;
import android.widget.Button;
import android.widget.TextView;

import com.example.dblianxiwj.dao.DiaryDao;

public class CountRJActivity extends Activity {

	private TextView textView=null;
	private Button quXiaoButton=null;
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_count_rj);
		MyHelpExit.getInstance().addActivity(this); 
		textView=(TextView)this.findViewById(R.id.count_text);
		DiaryDao diaryDao=new DiaryDao(this);
		long count= diaryDao.count();
		textView.setText(count+"ƪ");
		textView.setTextColor(Color.BLUE);
		quXiaoButton=(Button)this.findViewById(R.id.quXiao_count);
		quXiaoButton.setOnClickListener(new Button.OnClickListener()
		{

			@Override
			public void onClick(View v) {
				Intent intent =new Intent();
				intent.setClass( CountRJActivity.this,MainActivity.class);
				startActivity(intent);
				
			}
			
		}
		);
		
		
		
	}

	@Override
	public boolean onCreateOptionsMenu(Menu menu) {
		// Inflate the menu; this adds items to the action bar if it is present.
		getMenuInflater().inflate(R.menu.count_rj, menu);
		return true;
	}

}
